package com.slz3.business.module.configManagement.conZoneManage.service;

import com.slz3.business.frame.module.Repositorys;
import com.slz3.business.module.configManagement.conZoneManage.domain.ConZoneManage;
import com.slz3.business.module.configManagement.conZoneManage.domain.ConZoneManageFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Slf4j
@Service
public class ConZoneManageTransactionalServiceImpl implements ConZoneManageTransactionalService {

    @Override
    public ConZoneManage modify(ConZoneManage conZoneManageNew) {
        Repositorys.conZoneManage.test();
        Repositorys.conZoneManage.save(ConZoneManageFactory.initBaseFields());
        System.err.println(1/0);
        conZoneManageNew.setLastModifyTime(LocalDateTime.now());
        return Repositorys.conZoneManage.saveAndFlush(conZoneManageNew);
    }

    @Override
    public List<ConZoneManage> batchModify(List<ConZoneManage> conZoneManageList) {
        return Repositorys.conZoneManage.saveAll(conZoneManageList);
    }
}
